package com.lengxf.netty;

import com.lengxf.netty.config.ChannelContextHolder;
import jakarta.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.annotation.Order;


@Slf4j
@SpringBootApplication
public class NettyClientApplication {

    public static void main(String[] args) {
        SpringApplication.run(NettyClientApplication.class, args);
    }

    @Order(1)
    @PostConstruct
    public void initClient() {
        new Thread(() -> ChannelContextHolder.getNettyClient().run()).start();
    }

}
